package com.diaosidadui.duotai02;

public class AnimalDemo {
    public static void main(String[] args) {
        Animal dd = new Dog();
        dd.setAge(3);
        dd.setName("旺财");
        System.out.println(dd.getName()+","+dd.getAge());
        dd.eat(dd.getName());
        System.out.println("______________________");

        Animal dd2 = new Dog("旺财2",2);
        System.out.println(dd2.getName()+","+dd2.getAge());
        dd.eat(dd2.getName());

    }


}
